<!-- header 页面内容 -->
<div class="header" ng-controller="headerCtrl">
    <nav class="navbar navbar-fixed-top navbar-default yf-shadow" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" ng-click="toggleSide();">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" ui-sref='home'>
                    <img src="components/header/imgs/logo1.png" alt="">
                </a>
            </div>
            <!-- dds -->
            <div class="collapse mycollapse navbar-collapse bs-example-navbar-collapse-1" aria-expanded="true">
    
                <ul ng-show="user_role == 0" class="nav navbar-nav yf-header-btn links" ng-mouseup='closeMenu();'>
                    <!-- <li ui-sref-active="active" ui-sref="home">
                        <a class="two-size">
                                首页
                                <div class="line"></div>
                            </a>
                    </li> -->
                    <li ui-sref-active="active" ui-sref="reservation.demand">
                        <a class="four-size">
                                预订服务
                                <div class="line"></div>
                            </a>
                    </li>
                </ul>
                <ul ng-show="user_role == 1" class="nav navbar-nav yf-header-btn links" ng-mouseup='closeMenu();'>
                    <!-- <li ui-sref-active="active" ui-sref="home">
                        <a class="two-size">
                                首页
                                <div class="line"></div>
                            </a>
                    </li> -->
                    <li ui-sref-active="active" ui-sref="reservation.demand">
                        <a class="four-size">
                                预订服务
                                <div class="line"></div>
                            </a>
                    </li>
                </ul>
                <ul ng-show="user_role == 2" class="nav navbar-nav yf-header-btn links" ng-mouseup='closeMenu();'>
                    <li ui-sref-active="active" ui-sref="service-allorders">
                        <a class="four-size">
                                所有订单
                                <div class="line"></div>
                            </a>
                    </li>
                    <li ui-sref-active="active" ui-sref="service-maporders">
                        <a class="four-size">
                                地图订单
                                <div class="line"></div>
                            </a>
                    </li>
                    <li ui-sref-active="active" ui-sref="reservation.demand" ng-if="user.user_type=='dealer'">
                        <a class="four-size">
                                预订服务
                                <div class="line"></div>
                            </a>
                    </li>
                </ul>
                <ul ng-show="[0,1,2].indexOf(user_role) == -1" class="nav navbar-nav yf-header-btn links" ng-mouseup='closeMenu();'>
                    <!-- <li ui-sref-active="active" ui-sref="home">
                        <a class="two-size">
                                首页
                                <div class="line"></div>
                            </a>
                    </li> -->
                    <li ui-sref-active="active" ui-sref="reservation.demand">
                        <a class="four-size">
                                预订服务
                                <div class="line"></div>
                            </a>
                    </li>
                    <li ui-sref-active="active" ui-sref="service">
                        <a class="five-size">
                                服务商加盟
                                <div class="line"></div>
                            </a>
                    </li>
                    <li ui-sref-active="active" ui-sref="brand">
                        <a class="five-size">
                                品牌商加盟
                                <div class="line"></div>
                            </a>
                    </li>
                </ul>
                <ul class="nav navbar-nav yf-header-btn navbar-right btns" ng-show="!token" ng-mouseup='closeMenu();'>
                    <li><a ui-sref="login" class="header-btn header-sign-in">登录</a></li>
                    <li><a ui-sref="register" class="header-btn header-sign-up">注册</a></li>
                </ul>
                <ul class="nav navbar-nav yf-header-btn navbar-right users" ng-show="token">
                    <!-- <li>
                        <a class="header-btn header-bell">
                            <i class="glyphicon glyphicon-bell 2x"></i>
                        </a>
                    </li> -->
                    <!-- <li ng-click="issetting = !issetting" class='headerperson'> -->
                    <li ng-click="ToggleAlert();" class='headerperson'>
                        <div class="header-btn header-img" id='headpopover' data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            <!-- <img ng-src="{{ user.headimg.url }}"> -->
                            <img ng-src="{{ user.headimg.url }}?imageView2/1/w/200/h/200/interlace/1" onerror="this.src='components/mine/imgs/image.jpg'">
                            <div class="real-name">
                              {{ user.real_name }}
                              <i class="caret"></i>
                            </div>
                        </div>
                        <ul class="dropdown-menu modalpersonal1" role="menu" aria-labelledby="headpopover" ng-click="closeMenu();" ng-show="issetting" ng-mouseup='closeMenu();'>
                            <!-- <li>
                                {{ user.real_name }},你好！
                            </li> -->
                            <li ui-sref-active='active' ui-sref="mine.list({ ctrl: 'angular-flatpickr,orders' })">
                                我的订单
                            </li>
                            <li ui-sref-active='active' ui-sref="mine.list({ ctrl: 'zoom,uploadCtrl,personal' })">
                                个人资料
                            </li>
                            <li ui-sref-active='active' ui-sref="mine.list({ ctrl: 'setting' })">
                                账户设置
                            </li>
                            <li ng-click="logout();">
                                退出
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
        <div class="alert alert-warning alert-dismissible" role="alert" ng-show='alert.close'>
            <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
            <!-- <a href="#/mine/list/angular-flatpickr,orders"><strong>Warning!</strong> Better check yourself, you're not looking too good.</a> -->
            <div ng-bind-html="alert.tpl | to_trusted"></div>
        </div>
    </nav>

    <div class="container-fluid visible-xs left-menu-side">
      <div class="row margin-reset nologin-menu" ng-if="!token" ng-click="toggleSide();">
          <ul>
              <!-- <li ui-sref-active="active" ui-sref="home">
                  <a class="two-size">
                          首页
                          <div class="line"></div>
                      </a>
              </li> -->
              <li ui-sref-active="active" ui-sref="reservation.demand">
                  <a class="four-size">
                          预订服务
                          <div class="line"></div>
                      </a>
              </li>
              <li ui-sref-active="active" ui-sref="service">
                  <a class="five-size">
                          服务商加盟
                          <div class="line"></div>
                      </a>
              </li>
              <li ui-sref-active="active" ui-sref="brand">
                  <a class="five-size">
                          品牌商加盟
                          <div class="line"></div>
                      </a>
              </li>
              <li ui-sref="login">
                  <a class="green-text" href="">
                      登录
                  </a>
              </li>
              <li ui-sref="register">
                  <a class="green-text" href="">
                      注册
                  </a>
              </li>
          </ul>
      </div>

      <div class="row margin-reset login-menu" ng-if="token" ng-click="toggleSide();">
        <div class="row user-img text-center">
          <img class="img-circle" ng-src="{{ user.headimg.url }}?imageView2/1/w/200/h/200/interlace/1">
        </div>

        <div class="row user-info text-center">
          <h5>
            {{ user.real_name }}
            <i class="icon-renzheng" ng-if='user_role != 0'></i>
            <span class="real-name-title" ng-if='user_role == 1'>
              品牌商
            </span>
            <span class="real-name-title" ng-if='user_role == 2'>
              服务商
            </span>
          </h5>
          <p ng-if='user_role != 2'>{{ user.email }}</p>
          <p class="star" ng-if='user_role == 2'>
              <star len='user.raty'></star>
              <span>{{ user.orders_count }}单 好评 {{ user.raty | raty }}</span>
          </p>
        </div>

        <div class="row all-menu">
          <div class="list-group">
              <a href="javascript:void(0);" class="list-group-item disabled list-group-item-title">
              </a>
              <!-- <a ui-sref-active="active" ui-sref="home" class="list-group-item">
                  首页
              </a> -->
              <a ui-sref-active="active" ui-sref="reservation.demand" class="list-group-item">
                  预订服务
              </a>
              <a ng-if="user_role == 2" ui-sref-active="active" ui-sref="service-allorders" class="list-group-item">
                  所有订单
              </a>
              <a ng-if="user_role == 2" ui-sref-active="active" ui-sref="service-maporders" class="list-group-item">
                  地图订单
              </a>
          </div>
          <div class="list-group">
              <a href="javascript:void(0);" class="list-group-item disabled list-group-item-title">
                  订单
              </a>
              <a ng-repeat='role in mineListByRole track by $index' ui-sref-active='active' ng-class="{'active': select(role)}" ui-sref="mine.list({ctrl: role.params})" class="list-group-item">
                  <i class="icon-{{ role.icon }}"></i> {{role.name}}
              </a>
          </div>
          <div class="list-group">
              <a href="javascript:void(0);" class="list-group-item disabled list-group-item-title">
                  账户
              </a>
              <a ng-repeat='role in defaultlist track by $index' ui-sref-active='active' ng-class="{'active': select(role)}" ui-sref="mine.list({ctrl: role.params})" class="list-group-item">
                  <i class="icon-{{ role.icon }}"></i> {{role.name}}
              </a>
          </div>
          <div class="list-group" ng-if='user_role == 1'>
              <a href="javascript:void(0);" class="list-group-item disabled list-group-item-title">
                  成员
              </a>
              <a ng-repeat='role in brandmanagerlist track by $index' ui-sref-active='active' ng-class="{'active': select(role)}" ui-sref="mine.list({ctrl: role.params})" class="list-group-item">
                  <i class="icon-{{ role.icon }}"></i> {{role.name}}
              </a>
          </div>
          <div class="list-group">
              <a ng-click="logout();" class="list-group-item">
                  退出
              </a>
          </div>
        </div>
      </div>
    </div>
    <div class="container-fluid visible-xs right-menu-side" ng-click="toggleSide();">&nbsp;</div>
</div>
